<?php

Yii::app()->clientScript->registerScriptFile($this->adminPath."/js/art-dialog/jquery.artDialog.js",CClientScript::POS_HEAD);
Yii::app()->clientScript->registerScriptFile($this->adminPath."/js/art-dialog/plugins/iframeTools.js",CClientScript::POS_HEAD);
Yii::app()->clientScript->registerScriptFile($this->adminPath."/js/jquery-ui-1.8.11.custom.min.js",CClientScript::POS_HEAD);
?>
    <link rel="stylesheet" type="text/css" href="<?php echo $this->adminPath; ?>/css/jquery-ui.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo $this->adminPath; ?>/js/art-dialog/skins/blue.css" />
    <!-- page title -->
    <div class="page-title" style="z-index: 780;">
        <div class="in" style="z-index: 770;">
            <div class="titlebar" style="z-index: 760;">	<h2 class="title">
                    公开课管理
                </h2><p>发布，修改，删除公开课信息。</p></div>
            <div class="clear" style="z-index: 740;"></div>
        </div>
    </div>
    <style>
        .grid-view {
            padding: 0;
        }
        table.tablesorters {
            background-color: #CDCDCD;
            font-family: arial;
            font-size: 12px;
            margin: 0 0;
            text-align: left;
            width: 100%;
        }
        table.tablesorters thead tr th {
            background-position: right center;
            background-repeat: no-repeat;
            color: #333333;
            cursor: pointer;
        }
        table.tablesorters tbody td {
            padding: 12px;
            vertical-align: middle;
        }
        table.tablesorters tbody td {
            border: 1px solid #D8E4E9;
            color: #6C7D8C;
            padding: 12px;
            vertical-align: top;
        }
        table.tablesorters thead tr th, table.tablesorter tfoot tr th {
            -moz-border-bottom-colors: none;
            -moz-border-left-colors: none;
            -moz-border-right-colors: none;
            -moz-border-top-colors: none;
            background: url("<?php echo $this->adminPath; ?>/img/tableshorter/titlebg.png") repeat-x scroll center bottom #EFF3F8;
            border-color: -moz-use-text-color #CBDAE8;
            border-image: none;
            border-left: 1px solid #CBDAE8;
            border-right: 1px solid #CBDAE8;
            border-style: none solid;
            border-width: medium 1px;
            font-size: 8pt;
            padding: 12px;
        }
        table.tablesorters tbody tr.odd {
            background-color: #FFFFFF;
        }
        table.tablesorters tbody tr:hover {
            background-color: #E4ECF3;
        }
        .newLoding{
            background: url("<?php echo $this->adminPath; ?>/img/loading/6.gif") no-repeat scroll center bottom #EFF3F8;
        }
        .page.selected a{
            background:#3E7CAC ;
            color:#FFFFFF;
        }
        .grid-view .button-column {
            text-align: center;
            width: 30px;
        }
    </style>

    <div class="content">
        <form  id="search_form"  method="post" >
            <div style="z-index: 650;" class="st-form-line">
                <div style="float:right" class="shortcuts-icons">
                    <a href="<?php echo $this->createUrl('excelPingFen',array('id'=>$id)) ?>" class="icon-button"><img width="18" height="18" src="/book/assets/1d255125/img/icons/button/create.png" alt="icon"><span>EXCEL导出</span></a>
                </div>
                <div style="z-index: 640;" class="clear"></div>
            </div>
        </form>
        <?php if($zjinfo){ ?>

        <?php foreach($zjinfo as $v){ ?>
        <div class="simplebox grid740" style="z-index: 500;">
            <div class="titleh" style="z-index: 490;">
                <h3><?php echo $v['user_name'] ?></h3>
                <?php
                $p_info = OpenPoint::model()->findAll('pid=:pid',array(':pid'=>0));
                ?>
            </div>
            <?php if($p_info){ ?>
                <?php foreach($p_info as $vv){ ?>
            <div class="grid-view" style="width:960px">
                <table class="tablesorters">
                    <thead>
                    <tr>
                        <th ><?php echo $vv->title; ?></th>
                        <th>评星</th></tr>
                    </thead>
                    <tbody>
                    <?php
                    $c_info = OpenPoint::model()->findAll('pid=:pid',array(':pid'=>$vv->id));
                    ?>
                <?php if($c_info){ ?>
                    <?php foreach($c_info as $vvv){ ?>
                    <tr class="odd">
                        <td style="width: 250px"><?php echo $vvv->title; ?></td>
                        <?php
                            $s_info = OpenStart::model()->find('oid=:oid and pid=:pid and uid=:uid and type=:type and opid=:opid',
                                array(
                                    ':oid'=>$id,
                                    ':pid'=>$vv->id,
                                    ':uid'=>$v['id'],
                                    ':type'=>2,
                                    ':opid'=>$vvv->id,
                                    ));

                        ?>

                        <?php if($s_info){ ?>
                        <td><?php echo $s_info->start ?></td>
                        <?php }else{ ?>
                            <td>-</td>
                        <?php } ?>
                    </tr>
                    <?php } ?>
                <?php } ?>
                    </tbody>
                </table>
            </div>
            <?php } ?>
            <?php } ?>
        </div>
            <?php } ?>
        <?php } ?>


        <?php if($tkinfo){ ?>

            <?php foreach($tkinfo as $v){ ?>
                <div class="simplebox grid740" style="z-index: 500;">
                    <div class="titleh" style="z-index: 490;">
                        <h3><?php echo $v['user_name'] ?></h3>
                        <?php
                        $p_info = OpenPoint::model()->findAll('pid=:pid',array(':pid'=>0));
                        ?>
                    </div>
                    <?php if($p_info){ ?>
                        <?php foreach($p_info as $vv){ ?>
                            <div class="grid-view" style="width:960px">
                                <table class="tablesorters">
                                    <thead>
                                    <tr>
                                        <th ><?php echo $vv->title; ?></th>
                                        <th>评星</th></tr>
                                    </thead>
                                    <tbody>
                                    <?php
                                    $c_info = OpenPoint::model()->findAll('pid=:pid',array(':pid'=>$vv->id));
                                    ?>
                                    <?php if($c_info){ ?>
                                        <?php foreach($c_info as $vvv){ ?>
                                            <tr class="odd">
                                                <td style="width: 250px"><?php echo $vvv->title; ?></td>
                                                <?php
                                                $s_info = OpenStart::model()->find('oid=:oid and pid=:pid and uid=:uid and type=:type and opid=:opid',
                                                    array(
                                                        ':oid'=>$id,
                                                        ':pid'=>$vv->id,
                                                        ':uid'=>$v['id'],
                                                        ':type'=>1,
                                                        ':opid'=>$vvv->id,
                                                    ));

                                                ?>

                                                <?php if($s_info){ ?>
                                                    <td><?php echo $s_info->start ?></td>
                                                <?php }else{ ?>
                                                    <td>-</td>
                                                <?php } ?>
                                            </tr>
                                        <?php } ?>
                                    <?php } ?>
                                    </tbody>
                                </table>
                            </div>
                        <?php } ?>
                    <?php } ?>
                </div>
            <?php } ?>
        <?php } ?>

    </div>
<?php
//是否存在用户数据


Yii::app()->clientScript->registerScript('add',"


    function renderUpdate(token){
        art.dialog.open(
        '".Yii::app()->createAbsoluteUrl("admin/observation/openUpdate")."'+'id/'+token,
        {
            title:'修改',
            lock: true,
            width: 800,
            height: 600
        });
    }

    function renderDelete(token){
        if(confirm('本操作不可恢复，确定继续？')){
            $.ajax({
                type:'POST',
                url: '".Yii::app()->createAbsoluteUrl('admin/observation/openDelete')."'+'id/'+token,
                data:{},
                dataType:'json',
                beforeSend:function(){
                    art.dialog.Talert('正在删除数据ing', 5);
                },
                success:function(e){
                    if(e.status ==1){
                        art.dialog.Talert(e.message, 2);
                        window.location.reload();
                    }else{
                        art.dialog.Talert(e.message, 2);
                        return false;
                    }
                }
            });
        }
    }
        $(function(){
            $('#idd').click(function(){
                art.dialog.open(
                '".Yii::app()->createAbsoluteUrl("admin/observation/openAdd")."',
                {
                    title:'新增公开课',
                    lock: true,
                    width: 800,
                    height: 600
                });
            })
        });

    ",CClientScript::POS_END);

?>